/*  1:   */ package org.intellij.plugins.relaxNG.xml.dom.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.psi.xml.XmlElement;
import com.intellij.util.xml.DomElement;
import com.intellij.util.xml.DomElementVisitor;
import com.intellij.util.xml.DomUtil;
import org.intellij.plugins.relaxNG.model.CommonElement;
import org.intellij.plugins.relaxNG.model.Div;
import org.intellij.plugins.relaxNG.model.Pattern;
import org.intellij.plugins.relaxNG.xml.dom.RngDomElement;

import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */ 
/* 14:   */ public abstract class RngDomElementBase
/* 15:   */   implements RngDomElement, Pattern<XmlElement>
/* 16:   */ {
/* 17:   */   public XmlElement getPsiElement()
/* 18:   */   {
/* 19:37 */     return getXmlElement();
/* 20:   */   }
/* 21:   */   
/* 22:   */   public void accept(CommonElement.Visitor paramVisitor)
/* 23:   */   {
/* 24:41 */     if ((this instanceof Div)) {
/* 25:42 */       paramVisitor.visitDiv((Div)this);
/* 26:   */     } else {
/* 27:44 */       paramVisitor.visitElement(this);
/* 28:   */     }
/* 29:   */   }
/* 30:   */   
/* 31:   */   public void acceptChildren(final CommonElement.Visitor paramVisitor)
/* 32:   */   {
/* 33:49 */     acceptChildren(new DomElementVisitor()
/* 34:   */     {
/* 35:   */       public void visitDomElement(DomElement paramAnonymousDomElement)
/* 36:   */       {
/* 37:51 */         if ((paramAnonymousDomElement instanceof CommonElement)) {
/* 38:52 */           ((CommonElement)paramAnonymousDomElement).accept(paramVisitor);
/* 39:   */         }
/* 40:   */       }
/* 41:   */     });
/* 42:   */   }
/* 43:   */   
/* 44:   */   protected static Pattern getPatternFrom(RngDomElement paramRngDomElement)
/* 45:   */   {
/* 46:59 */     if (paramRngDomElement == null) {
/* 47:59 */       return null;
/* 48:   */     }
/* 49:60 */     List localList = DomUtil.getChildrenOfType(paramRngDomElement, Pattern.class);
/* 50:61 */     return localList.size() > 0 ? (Pattern)localList.get(0) : null;
/* 51:   */   }
/* 52:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.xml.dom.impl.RngDomElementBase

 * JD-Core Version:    0.7.0.1

 */